package com.wolf.util;

import java.math.BigDecimal;

/**
 * @author sdyang
 * @create 2019-06-15 17:32
 **/
public class ReflectionUtil {

    public static Class getClazz(String className) throws ClassNotFoundException {
        Class<?> clazz = null;
        switch (className) {
            case "int":
                clazz = Integer.class;
                break;
            case "boolean":
                clazz = Boolean.class;
                break;
            case "byte":
                clazz = Byte.class;
                break;
            case "short":
                clazz = short.class;
                break;
            case "long":
                clazz = Long.class;
                break;
            case "double":
                clazz = double.class;
                break;
            case "float":
                clazz = float.class;
                break;
            case "NString":
                clazz = String.class;
                break;
            case "BigDecimal":
                clazz = BigDecimal.class;
                break;
            default:
                clazz = Class.forName(className);
        }
        return clazz;
    }
}
